package com.ym.soso.test.es;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@NoArgsConstructor
@ToString
@Document(indexName = "project", type = "project")
public class Project extends BaseIndex implements Serializable {

    @Field(type = FieldType.Keyword, searchAnalyzer = "ik_max_word", analyzer = "ik_max_word")
    private String username;
    private String password;
    private Integer enabled;

    public Project(String id, String username, String password, Integer enabled) {
        this.setId(id);
        this.username = username;
        this.password = password;
        this.enabled = enabled;
    }
}
